package uit.nfcmenu.waiter.activities;


import uit.nfcmenu.waiter.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;

public class LoginActivity extends Activity{
	
	public EditText txtUserName;
	public EditText txtPassword;
	public Button btnLogin;
	public Button btnCancel;
	public Spinner spinner;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login_dialog);
		txtUserName = (EditText) this.findViewById(R.id.txtUsername);
        txtPassword = (EditText) this.findViewById(R.id.txtPassword);
        btnLogin = (Button) this.findViewById(R.id.bntLogin);
        btnCancel = (Button) this.findViewById(R.id.bntCancel);
        spinner = (Spinner) findViewById(R.id.spinner);
        
        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
                this, R.array.Languages_array, android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
        
        btnLogin.setOnClickListener(new OnClickListener(){
	        	public void onClick(View v){
	//        		String username = txtUserName.getText().toString();
	//				String password = txtPassword.getText().toString();
	//        		if(username.equals("") && password.equals("")){
	//        			//Toast.makeText(WaiterActivity.this, "Login Successful",Toast.LENGTH_LONG).show();
	        			Intent intent = new Intent(LoginActivity.this, MainMenuActivity.class);
	        			startActivity(intent);
	//                } 
	//        		else{
	//        			Toast.makeText(LoginActivity.this, "Invalid Login",Toast.LENGTH_LONG).show();
	//                }
	        	}
	        }        		
        );
        
        btnCancel.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				finish();
			}
		}); 
	}
}